#ifndef ADMINUI_H
#define ADMINUI_H

#include <QMainWindow>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QMessageBox>
#include <QAction>
#include <QDebug>
#include <QSqlTableModel>
#include <math.h>

namespace Ui {
class adminui;
}

class adminui : public QMainWindow
{
    Q_OBJECT

public:
    explicit adminui(QSqlDatabase* db,QString account,QWidget *parent = nullptr);
    ~adminui();

private slots:
    void on_stackedWidget_currentChanged(int arg1);

    void on_actStudent_triggered();

    void on_actTeacher_triggered();

    void on_actCourse_triggered();

    void on_actGrade_triggered();

    void on_actChoiceCourse_triggered();

    void on_actEva_triggered();

    void on_actTest_triggered();

    void on_actTeachCourse_triggered();

    void on_actCredit_triggered();

    void on_btnAppendChoiceCourse_clicked();

    void on_btnDeleteChoiceCourse_clicked();

    void on_btnResetChoiceCourse_clicked();

    void on_btnSubmitChoiceCourse_clicked();

    void on_btnAppdenCourse_clicked();

    void on_btnDeleteCourse_clicked();

    void on_btnResetCourse_clicked();

    void on_btnSubmitCourse_clicked();

    void on_btnAppendCredit_clicked();

    void on_btnDeleteCredit_clicked();

    void on_btnResetCredit_clicked();

    void on_btnSubmitCredit_clicked();

    void on_btnAppendEva_clicked();

    void on_btnDeleteEva_clicked();

    void on_btnResetEva_clicked();

    void on_btnSubmitEva_clicked();

    void on_btnAppendGrade_clicked();

    void on_btnDeleteGrade_clicked();

    void on_btnResetGrade_clicked();

    void on_btnSubmitGrade_clicked();

    void on_btnAppendStudent_clicked();

    void on_btnDeleteStudent_clicked();

    void on_btnResetStudent_clicked();

    void on_btnSubmitStudent_clicked();

    void on_btnAppendTeachCourse_clicked();

    void on_btnDeleteTeachCourse_clicked();

    void on_btnResetTeachCourse_clicked();

    void on_btnSubmitTeachCOurse_clicked();

    void on_btnAppendTeacher_clicked();

    void on_btnDeleteTeacher_clicked();

    void on_btnResetTeacher_clicked();

    void on_btnSubmitTeacher_clicked();

    void on_btnAppendTest_clicked();

    void on_btnDeleteTest_clicked();

    void on_btnResetTest_clicked();

    void on_btnSubmitTest_clicked();

    void on_actQuit_triggered();

    void on_btnScreen_clicked();

    void on_btnFind_clicked();

private:
    Ui::adminui *ui;

    QSqlDatabase m_db;//数据库连接
    QString m_account;//管理员账号
    QList<QAction*> m_actionList;//保存界面action

    QSqlTableModel* m_studentModel;//学生数据模型
    QSqlTableModel* m_teacherModel;//教师数据模型
    QSqlTableModel* m_courseModel;//课程数据模型
    QSqlTableModel* m_gradeModel;//成绩数据模型
    QSqlTableModel* m_choiceCourseModel;//选课数据模型
    QSqlTableModel* m_evaModel;//评价数据模型
    QSqlTableModel* m_tesetModel;//测试数据模型
    QSqlTableModel* m_teachCourseModel;//授课数据模型
    QSqlTableModel* m_creditModel;//学分数据模型

    void ini();//界面初始化函数
    void setHeaderLabels();//设置表格表头信息
};

#endif // ADMINUI_H
